home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_13817.txt < prev    next >
Text File  |  1989-05-10  |  9KB  |  300 lines

  1. -- card: 13817 from stack: in.6
  2. -- bmap block id: 14002
  3. -- flags: 0000
  4. -- background id: 16130
  5. -- name: PICT Maker Menu
  6. ----- HyperTalk script -----
  7. on turnOn buttonNo
  8.   lock screen
  9.   repeat with counter = 1 to 3
  10.     if buttonNo = counter then
  11.       set the hilite of cd btn counter to TRUE
  12.       show cd fld counter
  13.     else
  14.       set the hilite of cd btn counter to FALSE
  15.       hide cd fld counter
  16.     end if
  17.   end repeat
  18.   set scroll of cd fld buttonNo to 0
  19.   show cd btn "Close Information"
  20.   unlock screen with visual effect dissolve
  21. end turnOn
  22.  
  23. on closeall
  24.   set cursor to watch
  25.   lock screen
  26.   repeat with x = 1 to 3
  27.     hide cd fld x
  28.     set hilite of cd btn x to FALSE
  29.   end repeat
  30.   hide cd btn "Close Information"
  31.   unlock screen with visual effect dissolve
  32. end closeall
  33.  
  34. on closecard
  35.   closeall
  36. end closecard
  37.  
  38.  
  39. -- part 1 (button)
  40. -- low flags: 00
  41. -- high flags: A004
  42. -- rect: left=17 top=90 right=112 bottom=194
  43. -- title width / last selected line: 0
  44. -- icon id / first selected line: 0 / 0
  45. -- text alignment: 1
  46. -- font id: 0
  47. -- text size: 12
  48. -- style flags: 0
  49. -- line height: 16
  50. -- part name: What is PICT Maker?
  51. ----- HyperTalk script -----
  52. on mouseUp
  53.   if the visible of cd fld (the number of me) then
  54.     closeall
  55.   else
  56.     put the number of me into displayinfo
  57.     turnOn displayinfo
  58.   end if
  59. end mouseUp
  60.  
  61.  
  62.  
  63. -- part 2 (button)
  64. -- low flags: 00
  65. -- high flags: A004
  66. -- rect: left=17 top=120 right=142 bottom=194
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 1
  70. -- font id: 0
  71. -- text size: 12
  72. -- style flags: 0
  73. -- line height: 16
  74. -- part name: How to use PICT Maker?
  75. ----- HyperTalk script -----
  76. on mouseUp
  77.   if the visible of cd fld (the number of me) then
  78.     closeall
  79.   else
  80.     put the number of me into displayinfo
  81.     turnOn displayinfo
  82.   end if
  83. end mouseUp
  84.  
  85.  
  86.  
  87. -- part 3 (button)
  88. -- low flags: 00
  89. -- high flags: A004
  90. -- rect: left=17 top=150 right=172 bottom=194
  91. -- title width / last selected line: 0
  92. -- icon id / first selected line: 0 / 0
  93. -- text alignment: 1
  94. -- font id: 0
  95. -- text size: 12
  96. -- style flags: 0
  97. -- line height: 16
  98. -- part name: Future Enhancements
  99. ----- HyperTalk script -----
  100. on mouseUp
  101.   if the visible of cd fld (the number of me) then
  102.     closeall
  103.   else
  104.     put the number of me into displayinfo
  105.     turnOn displayinfo
  106.   end if
  107. end mouseUp
  108.  
  109.  
  110.  
  111. -- part 4 (button)
  112. -- low flags: 00
  113. -- high flags: A004
  114. -- rect: left=17 top=180 right=202 bottom=194
  115. -- title width / last selected line: 0
  116. -- icon id / first selected line: 0 / 0
  117. -- text alignment: 1
  118. -- font id: 0
  119. -- text size: 12
  120. -- style flags: 0
  121. -- line height: 16
  122. -- part name: Use PICT Maker
  123. ----- HyperTalk script -----
  124. on mouseUp
  125.   visual dissolve fast
  126.   go cd "PICT Maker 2"
  127. end mouseUp
  128.  
  129.  
  130.  
  131. -- part 5 (button)
  132. -- low flags: 00
  133. -- high flags: A004
  134. -- rect: left=17 top=210 right=232 bottom=194
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 1
  138. -- font id: 0
  139. -- text size: 12
  140. -- style flags: 0
  141. -- line height: 16
  142. -- part name: Print PICT Maker Docs
  143. ----- HyperTalk script -----
  144. on mouseUp
  145.   put cd fld 1 & return & cd fld 2 & return & cd fld 3 into container
  146.   put "PICT Maker Documentation" into prompt
  147.   PrintDoc prompt,container,prompt,times,12
  148. end mouseUp
  149.  
  150.  
  151.  
  152. -- part 6 (field)
  153. -- low flags: 81
  154. -- high flags: 2007
  155. -- rect: left=203 top=69 right=271 bottom=500
  156. -- title width / last selected line: 0
  157. -- icon id / first selected line: 0 / 0
  158. -- text alignment: 0
  159. -- font id: 3
  160. -- text size: 10
  161. -- style flags: 0
  162. -- line height: 13
  163. -- part name: 
  164. ----- HyperTalk script -----
  165. on mouseDown
  166.   set the lockText of me to false
  167.   click at the clickLoc
  168.   click at the clickLoc
  169.   put selection into theSelect
  170.   if theSelect Γëá "Click here to go there" then
  171.     click at loc of target
  172.   else
  173.     go cd "Auxiliary X-Commands"
  174.     send mouseUp to cd btn "ColorOn XFCN"
  175.   end if
  176.   set the lockText of me to true
  177. end mouseDown
  178.  
  179.  
  180.  
  181. -- part 7 (button)
  182. -- low flags: 80
  183. -- high flags: A004
  184. -- rect: left=283 top=278 right=299 bottom=434
  185. -- title width / last selected line: 0
  186. -- icon id / first selected line: 0 / 0
  187. -- text alignment: 1
  188. -- font id: 0
  189. -- text size: 12
  190. -- style flags: 0
  191. -- line height: 16
  192. -- part name: Close Information
  193. ----- HyperTalk script -----
  194. on mouseUp
  195.   closeall
  196. end mouseUp
  197.  
  198.  
  199.  
  200. -- part 8 (field)
  201. -- low flags: 81
  202. -- high flags: 2007
  203. -- rect: left=203 top=69 right=271 bottom=500
  204. -- title width / last selected line: 0
  205. -- icon id / first selected line: 0 / 0
  206. -- text alignment: 0
  207. -- font id: 3
  208. -- text size: 10
  209. -- style flags: 0
  210. -- line height: 13
  211. -- part name: 
  212. ----- HyperTalk script -----
  213. on mouseUp
  214.  
  215. end mouseup
  216.  
  217.  
  218. -- part 10 (field)
  219. -- low flags: 81
  220. -- high flags: 2007
  221. -- rect: left=203 top=69 right=271 bottom=500
  222. -- title width / last selected line: 0
  223. -- icon id / first selected line: 0 / 0
  224. -- text alignment: 0
  225. -- font id: 3
  226. -- text size: 10
  227. -- style flags: 0
  228. -- line height: 13
  229. -- part name: 
  230. ----- HyperTalk script -----
  231. on mouseUp
  232.  
  233. end mouseup
  234.  
  235.  
  236. -- part contents for card part 6
  237. ----- text -----
  238. ShowDialog XCMD supports very sophisticated handling of PICT resources for the display of graphics within ShowDialog dialog boxes.  Ordinarily, you would create your graphic in a paint application such as MacPaintΓäó or SuperPaintΓäó and copy the artwork into a stack using ResEdit.
  239.  
  240. HyperCard itself is an excellent painting application. 
  241.  
  242. So if you prefer, you can prepare your artwork in this stack.  PICT Maker will convert your artwork into a PICT resource and save it into this stack.  
  243.  
  244. Since HyperCard's painting tools are limited to black & white, if you wish to make color PICTs you'll still have to use ResEdit to install them into a stack.
  245.  
  246. Color PICTs can be created using programs such as PixelPaintΓäó and Studio 8 or any of the other color paint programs available for the Mac II.  After creating the color graphic, select it and copy it to the clipboard.  Open the "destination" stack with ResEdit and paste in the graphic as a PICT resource.
  247.  
  248. Be sure to test your finished dialog that contains a color PICT in B&W mode to make sure that the PICT still looks "allright" in B&W.  There doesn't seem to be any rule-of-thumb for predicting how certain colors will look when displayed in B&W.  You just have to try it and see.
  249.  
  250. Your better alternative is to employ the ColorOn XFCN that is included in this stack to test if your monitor is in color mode or not.  If it is, show a dialog containing a color PICT; if it's in B&W mode, show another dialog, containing an identical, but B&W PICT.  That way you can have your cake and eat it too!
  251.  
  252. See the card "Auxiliary X-Commands" for a description of ColorOn XFCN. 
  253.  ΓÇó Click┬áhere┬áto┬ágo┬áthere. ΓÇó
  254.  
  255.  
  256.  
  257. -- part contents for card part 8
  258. ----- text -----
  259. PICT Maker uses an XFCN called Ants that returns the coordinates of a rectangle drawn out with the mouse and an XMCD called ClipToPICT to copy whatever picture is on the clipboard into a PICT resource and place it in the current stack.
  260.  
  261. The arguments of ClipToPICT XCMD are:
  262. ClipToPICT <new PICT resource ID>,<new PICT name>
  263.  
  264. where
  265. <new PICT resource ID> 
  266. is the resource ID number for the new PICT;
  267. <new PICT name> is the name of the new PICT resource.
  268.  
  269. If you pass "0" (that's a zero) as the first parameter, ClipToPICT will assign its own unique ID to the new resource.
  270.  
  271. If you leave the second parameter empty (that doesn't mean that you can OMIT the second parameter) then the new PICT will be unnamed.
  272.  
  273. If everything goes alright the ID of the new PICT resource will be returned in "the result."  If something goes wrong the following errors are returned in the result:
  274.  
  275. Error:  You must provide 2 parameters (PICT ID and name)!
  276. Error:  That PICT resource ID already exists!
  277. Error:  That PICT name already exists!
  278. Error:  There isn't a picture on the clipboard!
  279. Error:  Unable to open the stack!
  280.  
  281. Any disk related errors will be reported by
  282. Error:  <OSError>
  283. where <OSError> is one of the standard Macintosh operating system error codes.  The ones that you potentially will encounter with ClipToPICT are:
  284. -34:  disk full
  285. -44:  disk locked
  286. -61:  file locked
  287.  
  288. As you can deduce from the error messages, ClipToPICT will not write over a previously existing PICT resource if it has the same ID or name as the new one.  If there isn't anything on the clipboard (or there is text), ClipToPICT will exit without creating a resource.
  289.  
  290. Ants XFCN 1.1 and 
  291. ClipToPICT XCMD 1.11 are 
  292. Copyright┬⌐ 1988 by Jay Hodgdon
  293.  
  294.  
  295.  
  296. -- part contents for card part 10
  297. ----- text -----
  298.  
  299. Stay tuned for a GREATLY enhanced resource 
  300. creator/mover!